<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMenusTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('menus', function (Blueprint $table) {
            $table->id();
            $table->boolean('hidden')->default(0)->comment('侧边栏隐藏 0:显示 1:隐藏');
            $table->string('title', 30)->comment('菜单名称');
            $table->integer('pid')->default(0)->comment('上级菜单id');
            $table->string('icon', 40)->nullable()->comment('icon');
            $table->string('path', 40)->comment('前端路由路径');
            $table->string('name', 40)->comment('前端路由名称');
            $table->boolean('breadcrumb')->default(0)->comment("面包屑中显示 0:不显示 1:显示");
            $table->boolean('no_cache')->default(0)->comment("<keep-alive> 缓存 0:缓存 1:不缓存");
            $table->boolean('affix')->default(0)->comment("tags-view固定 0:不固定 1:固定");
            $table->integer('sort')->default(0)->comment('排序');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('menus');
    }
}
